﻿CREATE TRIGGER [dbo].[tr_Dealer_Insert]
ON dbo.t_Dealer
FOR INSERT
AS

UPDATE t_Dealer SET NameSpace = dbo.UserNameSpace()
WHERE ID IN (SELECT ID FROM inserted)

INSERT INTO t_Dealer_SalesPersons(DealerID,Name)
SELECT ID,'' FROM inserted
